package com.paw.hys.sb.client.factory;

import com.paw.hys.sb.client.ServiceHcClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author lvzihai
 * @date 2022/8/26
 **/
@Slf4j
@Component
public class ServiceHcClientFallbackFactory implements FallbackFactory<ServiceHcClient> {

  @Override
  public ServiceHcClient create (Throwable throwable) {
    return new ServiceHcClient() {
      @Override
      public String welcomeHc () {
        log.error("ServiceHcClientFallbackFactory error",throwable);
        return "welcomeHc fallback ";
      }
    };
  }
}
